# def func(message):
#     print(f"Got a message:{message}")

# 函数赋值
# send_message = func
# send_message("hello world")

# 函数作为参数
# def get_message(message):
#     return f"Got a message:{message}"

# def call(func,message):
#     print(func(message))
#
# call(get_message,"hello world")

# 支持嵌套
# 作为返回值
def func():
    def get_message(message):
        return f"Got a message:{message}"
    return get_message

send_message = func()
print(send_message("hello world"))